package com.gym.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gym.dao.LoseDao;
import com.gym.pojo.Employee;
import com.gym.pojo.Lose;
import com.gym.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LoseServiceImpl implements LoseService{
    @Resource
    private LoseDao loseDao;
    @Override
    public PageInfo<Lose> select(String losename, int page, int Limit) {
        PageHelper.startPage(page, Limit);
        PageInfo<Lose> pagee =new PageInfo<Lose>(loseDao.select(losename,page,Limit),5);
        return pagee;
    }

    @Override
    public Lose selectlosename(String losename) {
        return loseDao.selectlosename(losename);
    }

    @Override
    public boolean insert(Lose lose) {
        return loseDao.insert(lose)>0;
    }

    @Override
    public boolean update(Lose lose) {
        return loseDao.update(lose)>0;
    }

    @Override
    public boolean delete(int loseid) {
        return loseDao.delete(loseid)>0;
    }
}
